<?php

/**
 * class Referencedefaults
 *
 * Description for class Referencedefaults
 *
 * @author:
*/
Zend_Loader::loadClass("BaseDBRows");
Zend_Loader::loadClass("Referencedefault");
class Referencedefaults extends BaseDBRows {

	protected function setUp()
	{
		$this->_tableName = Referencedefault::_tablename;	
	}

	public function getPONumber($org_id) {
		Zend_Loader::loadClass("CodesUtility");
		Zend_Loader::loadClass("QueryCreator");

		$query = new QueryCreator();
		$query->addSelect("rd.id, rd.next_po_no, rd.po_prefix");
		$query->addFrom($this->_tableName . " as rd ");
		$query->addWhere(" rd.org_id = ". $org_id . " and rd.po_prefix = '". CodesUtility::PO_PREFIX . "'" );

		$db = DBCon::instance();
		$result = $db->executeQuery($query->createSQL());	
		return $result;	
	}
	
}

?>